package org.example.enums;

/**
 * 支付状态枚举
 */
public enum OrderStatusEnums {
    NO_PAY(0,"未支付"),PAY(1,"已支付"),COMPLETE(2,"已完成");
    private int id;

    private String desc;

    OrderStatusEnums(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public static OrderStatusEnums getEnum(int id){
        for (OrderStatusEnums enums: OrderStatusEnums.values()){
            if (enums.getId()==id) {
                return enums;
            }
        }
        return null;
    }

    public int getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }
}
